/* tslint:disable */
/* eslint-disable */
/**
 * Deepfence ThreatMapper
 * Deepfence Runtime API provides programmatic control over Deepfence microservice securing your container, kubernetes and cloud deployments. The API abstracts away underlying infrastructure details like cloud provider,  container distros, container orchestrator and type of deployment. This is one uniform API to manage and control security alerts, policies and response to alerts for microservices running anywhere i.e. managed pure greenfield container deployments or a mix of containers, VMs and serverless paradigms like AWS Fargate.
 *
 * The version of the OpenAPI document: v2.5.3
 * Contact: community@deepfence.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { exists, mapValues } from '../runtime';
import type { ModelCompliance } from './ModelCompliance';
import {
    ModelComplianceFromJSON,
    ModelComplianceFromJSONTyped,
    ModelComplianceToJSON,
} from './ModelCompliance';

/**
 * 
 * @export
 * @interface ModelComplianceScanResult
 */
export interface ModelComplianceScanResult {
    /**
     * 
     * @type {Array<string>}
     * @memberof ModelComplianceScanResult
     */
    benchmark_type: Array<string> | null;
    /**
     * 
     * @type {string}
     * @memberof ModelComplianceScanResult
     */
    cloud_account_id: string;
    /**
     * 
     * @type {number}
     * @memberof ModelComplianceScanResult
     */
    compliance_percentage: number;
    /**
     * 
     * @type {Array<ModelCompliance>}
     * @memberof ModelComplianceScanResult
     */
    compliances: Array<ModelCompliance> | null;
    /**
     * 
     * @type {number}
     * @memberof ModelComplianceScanResult
     */
    created_at: number;
    /**
     * 
     * @type {string}
     * @memberof ModelComplianceScanResult
     */
    docker_container_name: string;
    /**
     * 
     * @type {string}
     * @memberof ModelComplianceScanResult
     */
    docker_image_name: string;
    /**
     * 
     * @type {string}
     * @memberof ModelComplianceScanResult
     */
    host_name: string;
    /**
     * 
     * @type {string}
     * @memberof ModelComplianceScanResult
     */
    kubernetes_cluster_name: string;
    /**
     * 
     * @type {string}
     * @memberof ModelComplianceScanResult
     */
    node_id: string;
    /**
     * 
     * @type {string}
     * @memberof ModelComplianceScanResult
     */
    node_name: string;
    /**
     * 
     * @type {string}
     * @memberof ModelComplianceScanResult
     */
    node_type: string;
    /**
     * 
     * @type {string}
     * @memberof ModelComplianceScanResult
     */
    scan_id: string;
    /**
     * 
     * @type {{ [key: string]: number; }}
     * @memberof ModelComplianceScanResult
     */
    status_counts: { [key: string]: number; } | null;
    /**
     * 
     * @type {number}
     * @memberof ModelComplianceScanResult
     */
    updated_at: number;
}

/**
 * Check if a given object implements the ModelComplianceScanResult interface.
 */
export function instanceOfModelComplianceScanResult(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "benchmark_type" in value;
    isInstance = isInstance && "cloud_account_id" in value;
    isInstance = isInstance && "compliance_percentage" in value;
    isInstance = isInstance && "compliances" in value;
    isInstance = isInstance && "created_at" in value;
    isInstance = isInstance && "docker_container_name" in value;
    isInstance = isInstance && "docker_image_name" in value;
    isInstance = isInstance && "host_name" in value;
    isInstance = isInstance && "kubernetes_cluster_name" in value;
    isInstance = isInstance && "node_id" in value;
    isInstance = isInstance && "node_name" in value;
    isInstance = isInstance && "node_type" in value;
    isInstance = isInstance && "scan_id" in value;
    isInstance = isInstance && "status_counts" in value;
    isInstance = isInstance && "updated_at" in value;

    return isInstance;
}

export function ModelComplianceScanResultFromJSON(json: any): ModelComplianceScanResult {
    return ModelComplianceScanResultFromJSONTyped(json, false);
}

export function ModelComplianceScanResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelComplianceScanResult {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'benchmark_type': json['benchmark_type'],
        'cloud_account_id': json['cloud_account_id'],
        'compliance_percentage': json['compliance_percentage'],
        'compliances': (json['compliances'] === null ? null : (json['compliances'] as Array<any>).map(ModelComplianceFromJSON)),
        'created_at': json['created_at'],
        'docker_container_name': json['docker_container_name'],
        'docker_image_name': json['docker_image_name'],
        'host_name': json['host_name'],
        'kubernetes_cluster_name': json['kubernetes_cluster_name'],
        'node_id': json['node_id'],
        'node_name': json['node_name'],
        'node_type': json['node_type'],
        'scan_id': json['scan_id'],
        'status_counts': json['status_counts'],
        'updated_at': json['updated_at'],
    };
}

export function ModelComplianceScanResultToJSON(value?: ModelComplianceScanResult | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'benchmark_type': value.benchmark_type,
        'cloud_account_id': value.cloud_account_id,
        'compliance_percentage': value.compliance_percentage,
        'compliances': (value.compliances === null ? null : (value.compliances as Array<any>).map(ModelComplianceToJSON)),
        'created_at': value.created_at,
        'docker_container_name': value.docker_container_name,
        'docker_image_name': value.docker_image_name,
        'host_name': value.host_name,
        'kubernetes_cluster_name': value.kubernetes_cluster_name,
        'node_id': value.node_id,
        'node_name': value.node_name,
        'node_type': value.node_type,
        'scan_id': value.scan_id,
        'status_counts': value.status_counts,
        'updated_at': value.updated_at,
    };
}

